package com.wxy.demo.security;

import com.wxy.demo.util.Md5Utils;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
 * <p>
 * md5加密
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2023/1/5 11:10
 */
public class Md5Demo {
    public static void main(String[] args) {
        String str = DigestUtils.md5DigestAsHex("123456".getBytes(StandardCharsets.UTF_8));
        System.out.println(str);
        String str1 = Md5Utils.encode("123456");
        System.out.println(str1);
    }
}
